<template>
  <div>
    <CellGroup>
      <Cell is-link clickable title="退出登录" title-style="color:red;" @click="onLogout"></Cell>
    </CellGroup>
  </div>
</template>

<script setup name="My">
import { Cell, CellGroup } from 'vant';
import { useRouter } from 'vue-router';
import { useUserStore } from '../../stores/user';

const userStore = useUserStore();
const router = useRouter();

function onLogout(){
  userStore.LogOut().then(() => {
    router.push({path: '/login'});
  })
}
</script>

<style>
</style>